import { updateFile } from '@/api/budgetQuert'

export default {
  data() {
    return {
      importLoading: false,
      fileList: []
    }
  },
  methods: {
    /**
         * 批量导入 上传
         */
    fileChange(files) {
      this.importLoading = true
      const file = new FormData()
      file.append('file', files.raw)
      updateFile(file).then((res) => {
        this.importLoading = false
        if (res.code === 200) {
          files.status = 'success'
          files.url = res.data
          this.fileList.push(files)
        }
      }).catch(() => {
        this.importLoading = false
      })
    },

    remove(file, fileList) {
      this.fileList = fileList
    }
  }
}
